import {AnyAction} from "redux";
import {handleActions} from "redux-actions";
import initState from "./state";

export const patient = handleActions({
    "PATIENT_LIST": (state, action: AnyAction) => {
        return {...state, list: action.payload.data};
    },
    "PATIENT_CHOOSE": (state, action: AnyAction) => {
        return {...state, patient: action.payload.patient};
    },
    "PASS_DOCTOR": (state, action: AnyAction) => {
        return {...state, data: action.payload.data};
    },
    "APPOINTMENT_CONFIRM":(state,action:AnyAction)=>{
        return {...state};
    }

}, initState);